package com.asiainfo.dacp.datastash.broker.listener;

import com.asiainfo.dacp.core.BeanFactory;
import com.asiainfo.dacp.datastash.broker.core.BrokerContext;
import com.asiainfo.dacp.datastash.worker.executor.adapter.datax.utils.ConfigUtils;
import com.asiainfo.dacp.resource.service.ResourceRedisService;

public class BrokerMonitorQueueListener extends AbstractQueueListener {
	
	@Override
	protected void handle() {
		
		ResourceRedisService resourceRedisService = BeanFactory.getBean(ResourceRedisService.class);
		try {
			resourceRedisService.pushBorkerResource(BrokerContext.getInstance().getBrokerId(), BrokerContext.getInstance().getBrokerIp(), ConfigUtils.getCfg("diskName"));
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	protected int getIntervals(){
        return 3*60;
    }
}
